package com.hiultra.archive.service.impl;

import com.hiultra.archive.domain.ArcBorrowDetails;
import com.hiultra.archive.mapper.ArcBorrowDetailsMapper;
import com.hiultra.archive.service.IArcBorrowDetailsService;
import com.hiultra.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 借阅详情Service业务层处理
 * 
 * @author ls
 * @date 2022-07-28
 */
@Service
public class ArcBorrowDetailsServiceImpl implements IArcBorrowDetailsService
{
    @Autowired
    private ArcBorrowDetailsMapper arcBorrowDetailsMapper;

    /**
     * 查询借阅详情
     * 
     * @param detailId 借阅详情主键
     * @return 借阅详情
     */
    @Override
    public ArcBorrowDetails selectArcBorrowDetailsByDetailId(Long detailId)
    {
        return arcBorrowDetailsMapper.selectArcBorrowDetailsByDetailId(detailId);
    }

    /**
     * 查询借阅详情列表
     * 
     * @param arcBorrowDetails 借阅详情
     * @return 借阅详情
     */
    @Override
    public List<ArcBorrowDetails> selectArcBorrowDetailsList(ArcBorrowDetails arcBorrowDetails)
    {
        return arcBorrowDetailsMapper.selectArcBorrowDetailsList(arcBorrowDetails);
    }

    /**
     * 新增借阅详情
     * 
     * @param arcBorrowDetails 借阅详情
     * @return 结果
     */
    @Override
    public int insertArcBorrowDetails(ArcBorrowDetails arcBorrowDetails)
    {
        return arcBorrowDetailsMapper.insertArcBorrowDetails(arcBorrowDetails);
    }

    /**
     * 修改借阅详情
     * 
     * @param arcBorrowDetails 借阅详情
     * @return 结果
     */
    @Override
    public int updateArcBorrowDetails(ArcBorrowDetails arcBorrowDetails)
    {
        arcBorrowDetails.setUpdateTime(DateUtils.getNowDate());
        return arcBorrowDetailsMapper.updateArcBorrowDetails(arcBorrowDetails);
    }

    /**
     * 批量删除借阅详情
     * 
     * @param detailIds 需要删除的借阅详情主键
     * @return 结果
     */
    @Override
    public int deleteArcBorrowDetailsByDetailIds(Long[] detailIds)
    {
        return arcBorrowDetailsMapper.deleteArcBorrowDetailsByDetailIds(detailIds);
    }

    /**
     * 删除借阅详情信息
     * 
     * @param detailId 借阅详情主键
     * @return 结果
     */
    @Override
    public int deleteArcBorrowDetailsByDetailId(Long detailId)
    {
        return arcBorrowDetailsMapper.deleteArcBorrowDetailsByDetailId(detailId);
    }
}
